package com.kfm.filter;

import javax.servlet.*;
import java.io.IOException;

// 任何请求(符合要求的)都会经过过滤器,包括 静态资源(img,css,js,html)、动态资源(servlet)
//@WebFilter("/*")
public class MyFilter implements Filter {
    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
        System.out.println(this.getClass().getName() + "  start");

        // 放行
        filterChain.doFilter(servletRequest, servletResponse);

        System.out.println(this.getClass().getName() + "  end");
    }
}
